package com.employee.mapper;

import com.employee.pojo.dto.PositionDto;
import com.employee.pojo.dto.UpdatePosDto;
import com.employee.pojo.entry.PosHistory;
import com.employee.pojo.entry.Position;
import com.employee.pojo.vo.PosStaffVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PosMapper {
    List<PosHistory> getPosList(@Param("id") Long id);
    @Select("select * from postion")
    List<Position> getPositionList();
    @Select("select * from postion where pos_id = #{id}")
    Position getPositionById(@Param("id") Long id);

    List<PosStaffVo> getStaffList(@Param("id") Long id);
    @Insert("insert into postion(pos_name, level, status) values (#{posName},#{level},'活动') ")
    void addPosition(PositionDto positionDto);
    @Select("select * from postion where pos_name = #{posName}")
    Position selectPosByName(@Param("posName") String posName);

    void updatePosition(UpdatePosDto positionDto);

    List<Position> getPosListByQuery(@Param("posName") String posName,@Param("status") String status);

    void updateStatus(@Param("posId") Long posId,@Param("status") String status);

}

